package com.service2.controller

import com.base.model.Model_Service2
import com.base.service.IRPC_Service2
import com.netflix.hystrix.contrib.javanica.annotation.DefaultProperties
import com.netflix.hystrix.contrib.javanica.annotation.HystrixCommand
import com.yfree.global.YController
import org.springframework.beans.factory.annotation.Value
import org.springframework.web.bind.annotation.RestController

@RestController
@DefaultProperties(defaultFallback = "yfree_defaultFallback")
class Controller_Service2 : YController(), IRPC_Service2 {
    @Value("\${server.port}")
    private lateinit var serverPort: String

    @HystrixCommand
    override fun api(): String {
        return json(result = arrayListOf(
                Model_Service2("Server2Port:$serverPort")
        ))
    }
}
